From bf4b59a4c7dc168be4e758b778125767ad3b0670 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Tue, 22 Jan 2008 09:51:49 +0000 Subject: [PATCH] xend: On block-attach, remove device information when VmError occurs. I tested xm block-attach command with a wrong parameter(file:). Naturally a command error occurred. Then I retested xm block-attach command with a correct parameter(phy:). But a command error occurred again. The second command error occurred because Xend did not remove device information from self.info when the first command error occurred. Signed-off-by: Masaki Kanno --- tools/python/xen/xend/XendDomainInfo.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index f504e9cf89..052258ec55 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -535,6 +535,11 @@ class XendDomainInfo: self._createDevice(dev_type, dev_config_dict) self._waitForDevice(dev_type, devid) except VmError, ex: + del self.info['devices'][dev_uuid] + if dev_type == 'tap': + self.info['vbd_refs'].remove(dev_uuid) + else: + self.info['%s_refs' % dev_type].remove(dev_uuid) raise ex else: devid = None -- 2.30.2